package com.sx.zongzhi.presenter;

import android.content.Context;

import com.sx.zongzhi.bean.MailBean;
import com.sx.zongzhi.bean.WorkLogBean;
import com.sx.zongzhi.modle.ApiManager;
import com.sx.zongzhi.modle.HeadParamBean;
import com.sx.zongzhi.net.BaseCallBack;
import com.sx.zongzhi.net.BaseResult;
import com.sx.zongzhi.view.IInBoxDetailView;
import com.sx.zongzhi.view.WorkLogDetailView;

import java.util.Map;

/**工作日志
 * Created by admin on 2017/12/7.
 */

public class WorkLogDetailPest {
    private WorkLogDetailView workLogDetailView;

    public WorkLogDetailPest(WorkLogDetailView workLogDetailView) {
        this.workLogDetailView=workLogDetailView;
    }
//    //工作日志信息详情
//    public void getInBoxDetail(Context context, String id){
//        Map<String,Object> map = HeadParamBean.getHead(context);
//        map.put("id", id);
//        new ApiManager().getInBoxDetail(map, new BaseCallBack<BaseResult<WorkLogBean>>() {
//            @Override
//            public void onSuccess(BaseResult<WorkLogBean> response) {
//                workLogDetailView.getWorkLogDetailSuccess(response.getData());
//            }
//            @Override
//            public void onFailures(String message) {
//                workLogDetailView.showError(message);
//            }
//        });
//    }
    //删除工作日志信息
    public void deleteWorkLog(Context context, String id){
        Map<String,Object> map = HeadParamBean.getHead(context);
        map.put("id", id);
        new ApiManager().deleteWorkLog(map, new BaseCallBack<BaseResult<Boolean>>() {
            @Override
            public void onSuccess(BaseResult<Boolean> response) {
                workLogDetailView.deleteWorkLogSuccess(response.getData());
            }
            @Override
            public void onFailures(String message) {
                workLogDetailView.deletWorkLogFail(message);
            }
        });
    }
}
